﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NumericalData.DifferentialEquations.Data
{
    public class ODEAnswer : IEnumerable<ODEValue>
    {
        public List<ODEValue> OdeValues { get; private set; }

        public ODEAnswer()
        {
            OdeValues = new List<ODEValue>();
        }

        public ODEAnswer(List<ODEValue> values)
        {
            OdeValues = values;
        }

        public IEnumerator<ODEValue> GetEnumerator()
        {
            return OdeValues.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return OdeValues.GetEnumerator();
        }
    }

    public class ODEValue
    {
        public double T { get; private set; }
        public Vector Y { get; private set; }

        public ODEValue(double t, Vector y)
        {
            T = t;
            Y = y;
        }

        public double Item(int i)
        {
            return Y[i];
        }
    }
}
